package TwoSeach;

/**
 * @BelongsProject: SeniorArchitect-LeetCode
 * @BelongsPackage: TwoSeach
 * @Author: zhuangxiaoyan
 * @CreateTime: 2023-11-04  16:46
 * @Description: TODO
 * @Version: 1.0
 */
public class 第一个错误的版本278 {

    public int firstBadVersion(int n) {
        int left=1;
        int right=n;
        while (left<right){
            int mid=(left+right)>>1;
            if (!isBadVersion(mid)){
                left=mid+1;
            }else {
                right=mid;
            }
        }
        return left;
    }

    private boolean isBadVersion(int mid) {
        return false;
    }
}
